<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>深入理解 Java 虚拟机</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .content-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }
        
        .content-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .section-title {
            position: relative;
            padding-left: 20px;
        }
        
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 20px;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 14px;
            line-height: 1.6;
            position: relative;
        }
        
        .code-block::before {
            content: 'Java';
            position: absolute;
            top: 10px;
            right: 10px;
            color: #666;
            font-size: 12px;
            text-transform: uppercase;
        }
        
        .concept-card {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 30px;
            border-radius: 16px;
            position: relative;
            overflow: hidden;
        }
        
        .concept-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: pulse 3s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.1); opacity: 0.3; }
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px 30px;
            border-radius: 12px;
            margin: 20px 0;
            position: relative;
            overflow: hidden;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 30px 0;
        }
        
        .floating-icon {
            position: absolute;
            opacity: 0.1;
            animation: float 6s ease-in-out infinite;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-20px); }
        }
        
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .image-container {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            margin: 20px 0;
        }
        
        .image-container img {
            width: 100%;
            height: auto;
            display: block;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 relative overflow-hidden">
        <div class="floating-icon top-10 left-10">
            <i class="fas fa-code fa-3x"></i>
        </div>
        <div class="floating-icon bottom-10 right-10" style="animation-delay: 3s;">
            <i class="fas fa-server fa-3x"></i>
        </div>
        <div class="container mx-auto px-6 text-center relative z-10">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">深入理解 Java 虚拟机</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">探索 JVM 的核心概念、内存模型与优化技术</p>
            <div class="flex justify-center space-x-4">
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-book-open mr-2"></i>深度解析
                </span>
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-chart-line mr-2"></i>性能优化
                </span>
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                    <i class="fas fa-tools mr-2"></i>实战技巧
                </span>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12">
        <!-- 概念导图 -->
        <div class="content-card rounded-2xl shadow-xl p-8 mb-12">
            <h2 class="text-3xl font-bold mb-6 gradient-text">JVM 核心概念关系图</h2>
            <div class="mermaid">
                graph TD
                    A[Java程序] --> B[JDK]
                    B --> C[JRE]
                    B --> D[开发工具]
                    C --> E[JVM]
                    C --> F[核心类库]
                    E --> G[类加载器]
                    E --> H[运行时数据区]
                    E --> I[执行引擎]
                    E --> J[本地接口]
                    H --> K[堆]
                    H --> L[栈]
                    H --> M[方法区]
                    H --> N[程序计数器]
                    H --> O[本地方法栈]
                    K --> P[新生代]
                    K --> Q[老年代]
                    P --> R[Eden区]
                    P --> S[Survivor区]
                    
                    style A fill:#f9f,stroke:#333,stroke-width:2px
                    style E fill:#bbf,stroke:#333,stroke-width:2px
                    style H fill:#bfb,stroke:#333,stroke-width:2px
            </div>
        </div>

        <!-- Java基本概念 -->
        <section class="mb-16">
            <div class="content-card rounded-2xl shadow-xl p-8">
                <h2 class="text-3xl font-bold mb-8 section-title">Java 中的基本概念</h2>
                
                <div class="grid md:grid-cols-3 gap-6 mb-8">
                    <div class="concept-card">
                        <div class="relative z-10">
                            <i class="fas fa-cube fa-3x mb-4"></i>
                            <h3 class="text-2xl font-bold mb-3">JDK</h3>
                            <p class="text-sm opacity-90">Java 标准开发包，提供编译、运行 Java 程序所需的各种工具和资源，包括 Java 编译器、Java 运行时环境，以及常用的 Java 类库等。</p>
                        </div>
                    </div>
                    
                    <div class="concept-card" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
                        <div class="relative z-10">
                            <i class="fas fa-play-circle fa-3x mb-4"></i>
                            <h3 class="text-2xl font-bold mb-3">JRE</h3>
                            <p class="text-sm opacity-90">Java 运行时环境，所有的 Java 程序都要在 JRE 下才能运行。包括 JVM 和 JAVA 核心类库和支持文件。</p>
                        </div>
                    </div>
                    
                    <div class="concept-card" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);">
                        <div class="relative z-10">
                            <i class="fas fa-microchip fa-3x mb-4"></i>
                            <h3 class="text-2xl font-bold mb-3">JVM</h3>
                            <p class="text-sm opacity-90">Java 虚拟机，通过在实际的计算机上仿真模拟各种计算机功能来实现。具有完善的硬件架构和指令系统。</p>
                        </div>
                    </div>
                </div>
                
                <div class="highlight-box">
                    <h4 class="text-xl font-bold mb-3"><i class="fas fa-link mr-2"></i>三者关系</h4>
                    <p>JDK 包含 JRE，JRE 包含 JVM。JDK 是开发环境，JRE 是运行环境，JVM 是执行引擎。</p>
                </div>
            </div>
        </section>

        <!-- JVM体系结构 -->
        <section class="mb-16">
            <div class="content-card rounded-2xl shadow-xl p-8">
                <h2 class="text-3xl font-bold mb-8 section-title">JVM 体系结构</h2>
                
                <div class="grid md:grid-cols-2 gap-8 mb-8">
                    <div>
                        <h3 class="text-xl font-bold mb-4 gradient-text">运行时数据区</h3>
                        <div class="space-y-4">
                            <div class="bg-gray-50 p-4 rounded-lg hover:bg-gray-100 transition">
                                <h4 class="font-bold text-purple-600"><i class="fas fa-database mr-2"></i>方法区</h4>
                                <p class="text-sm text-gray-700 mt-2">存储每个类的信息、静态变量、常量以及编译器编译后的代码等。</p>
                            </div>
                            <div class="bg-gray-50 p-4 rounded-lg hover:bg-gray-100 transition">
                                <h4 class="font-bold text-blue-600"><i class="fas fa-layer-group mr-2"></i>虚拟机栈</h4>
                                <p class="text-sm text-gray-700 mt-2">线程私有，描述 Java 方法执行的内存模型，每个方法对应一个栈帧。</p>
                            </div>
                            <div class="bg-gray-50 p-4 rounded-lg hover:bg-gray-100 transition">
                                <h4 class="font-bold text-green-600"><i class="fas fa-memory mr-2"></i>堆</h4>
                                <p class="text-sm text-gray-700 mt-2">所有线程共享，存放对象实例，是垃圾回收的主要区域。</p>
                            </div>
                        </div>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-bold mb-4 gradient-text">JDK 版本对比</h3>
                        <div class="bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg">
                            <h4 class="font-bold mb-3">JDK 1.7 → JDK 1.8 主要变化</h4>
                            <ul class="space-y-2 text-sm">
                                <li class="flex items-start">
                                    <i class="fas fa-arrow-right text-purple-600 mr-2 mt-1"></i>
                                    <span><strong>永久代 → 元空间：</strong>元空间使用本地内存，不受堆大小限制</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-arrow-right text-purple-600 mr-2 mt-1"></i>
                                    <span><strong>直接内存：</strong>使用本地内存，提高 I/O 操作性能</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 类加载机制 -->
        <section class="mb-16">
            <div class="content-card rounded-2xl shadow-xl p-8">
                <h2 class="text-3xl font-bold mb-8 section-title">类加载机制</h2>
                
                <div class="mb-8">
                    <h3 class="text-xl font-bold mb-4 gradient-text">类加载过程</h3>
                    <div class="mermaid">
                        graph LR
                            A[.java文件] -->|编译| B[.class文件]
                            B -->|加载| C[类加载器]
                            C --> D[加载